/* scripts/login.js 编码为 utf-8  */

$(function(){
	$('#exitBtn').click(logoutAction);
});

function logoutAction(){
	var userId = getCookie("userId");
	var data={
		'userId':userId	
	}
	$.ajax({
		url:'user/logout.do',
		type:'post',
		data:data,
		dataType:'json',
		success: function(result){
			console.log(result);
			if(result.state==0){
				delCookie("userId");
				location.href='log_in.html';
			}else{
				var msg = result.message;
				alert(msg);
			}
		},
		error: function(e){
			alert("通信失败!");
		}
	});
}








